

 function createProjectModulePanel(){
    
    var issueStore      			= CRM.commons.createStore('issueStoreid', CRM.SPComp.issueDataArray, 'issue/issueByProjectId');
    var memberTypeStore 			= CRM.commons.createComboStore('memberTypeStoreid', '<spring:url value="project/memberTypeList"/>','');
    var projectStore    			= CRM.commons.createStore('projectStoreid',CRM.SPComp.projectDataArray,'project/showProjectDetails');
    var projectSearchStore 			= CRM.commons.createStore('projectSearchStoreid',CRM.SPComp.projectDataArray,'project/showProjectList');
	var projectSearchCriteriaStore 	= CRM.commons.createComboStore('searchCriteriaid','project/projectSearchTypes','');
	var memberStore 				= CRM.commons.createStore('memberStoreid', CRM.SPComp.userDataArray, 'project/memberListByProjectId');
	var memberTypeStore 			= CRM.commons.createComboStore('memberTypeStoreid','project/memberTypeList','');
	var statusStore					= CRM.commons.createComboStore('statusStoreid','project/projectReqCombo','statusTypes');
    var priorityStore 				= CRM.commons.createComboStore('priorityStoreid','project/projectReqCombo','priorityTypes');
    var contactToStore 				= CRM.commons.createComboStore('contactToStoreid','project/findContactName','');
    var customerStore  				= CRM.commons.createStore('customerStoreid',CRM.SPComp.customerDataArray,'project/showCustomer');
    
    var projectTaskStore=CRM.commons.createStore('projectTaskStore',CRM.SPComp.projectTaskArray,'projectTask/tasksListByProjectId');
	var mytaskstore=CRM.commons.createStore('mutaskstore',CRM.SPComp.projectTaskArray,'projectTask/taskForme');
	
	var taskHomeGrid=CRM.commons.createGrid('taskHomeGrid',projectTaskStore,CRM.SPComp.projectTaskColModel('taskHomeGrid'));
	var mytaskGrid=CRM.commons.createGrid('mytaskGrid',mytaskstore,CRM.SPComp.projectTaskColModel('mytaskGrid'));
	
	var taskGridColumnModel = CRM.SPComp.projectTaskColModel('taskHomeGrid');
	taskGridColumnModel.setHidden(0,true);
	taskGridColumnModel.setHidden(3,true);
	taskGridColumnModel.setHidden(8,true);
	taskGridColumnModel.setHidden(9,true);
	taskGridColumnModel.setHidden(14,true);
	
	var mainProjectFromIds = ["projectName"];
	
	 // Issue Home Store and grid
	var issueHomeStore = CRM.commons.createStore('issueHomeStore',CRM.SPComp.dashboardDataArray,'searchIssueDashboard/findAllByProjectId');
	var issueHomeGrid=CRM.commons.createGrid('issueHomeGrid', issueHomeStore, CRM.SPComp.createDashboardColumnModel('issueHomeGrid'));
	// My Issue Store and grid
	var myIssueStore=CRM.commons.createStore('myIssueStore',CRM.SPComp.dashboardDataArray,'searchIssueDashboard/issueForm');
	var myIssueGrid=CRM.commons.createGrid('myIssueGrid',myIssueStore,CRM.SPComp.createDashboardColumnModel('myIssueGrid')); 
	var issueGridColumnModel = CRM.SPComp.createDashboardColumnModel('issueHomeGrid');
	issueGridColumnModel.setHidden(11,true); 
	
	//for uploading document
	 var uploadProjectDocStore=CRM.commons.createStore('uploadProjectDocStoreid',CRM.SPComp.uploadDocDataArray,'projectdocument/docList');
	
	var basicInformationPanel = {
			xtype		: 'fieldset',
			title		: 'Project Information',
			id			: 'basicInformationPanel',
			labelWidth	: 120,
			//frame		: true,
			layout      : 'form',
			autoHeight  : true,
			items		: [
			     		    {
			     		    	xtype       : 'hidden',
			     		    	id          : 'projectId',
			     		    	fieldLabel  : 'Project Id'
			     		    },
			     		   	{
			     		   		xtype		: 'textfield',
			     		   		id			: 'projectName',
			     		   		fieldLabel	: 'Project Name<font color=red>*</font>',
			     		   		width		: 490	
			     		   	},
			     		   	{
			     		   		xtype		: 'compositefield',
			     		   		fieldLabel	: 'Related To',
			     		   		items		: [
			     		   		     		    {
			     		   		     		    	xtype      : 'hidden',
			     		   		     		    	id         : 'leadId',
			     		   		     		    	fieldLabel : 'Company Id'
			     		   		     		    },
			     		   		     		    {
			     		   		     		    	xtype		: 'textfield',
			     		   		     		   	 	id			: 'companyCustomer',
			     		   		     		   	 	width		: '61%'		
			     		   		     		    },
			     		   		     		    {
			     		   		     		    	xtype		: 'button',
			     		   		     		    	id			: 'searchButton',
			     		   		     		    	text		: 'Search',
			     		   		     		    	handler     : function(){
			     		   		     		    	showCustomerSearchWindow(); //this function is in Project.js file
			     		   		     		    	}
			     		   		     		    }
			     		   		     		   ]
			     		   	},
			     		   {
	                            xtype        : 'combo',
	                            fieldLabel   : 'Contact To',
	                            id           : 'contactTo',
	                            valueField   : 'id',
	                            value        :'SELECT',
	                            store        : contactToStore, 
	                            displayField : 'criteria',
	                            triggerAction: 'all',
	                            typeAhead    : true,
	                            editable     : false,
	                            autoLoad     : false,
	                            //width        : '40%',
	                            mode		 :'local',
	       				     	emptyText	 : 'SELECT',
	       				     	lastQuery	 :'',
	                            listeners    : {select: function() 
			     		   		                 {
			     		                    	    bindValue('contactTo', 'contactToId');
			     		   		                  }
	                            	            }
					         },
					         {
					              	xtype		: 'hidden',
					              	id			: 'contactToId'
					        },
			     		    {
			     		   		xtype		: 'compositefield',
			     		   		fieldLabel	: 'Status',
			     		   		items		: [

			     		   		     		    {
			     		   		     		    	xtype		  : 'combo',
			     		   		     		   	 	id			  : 'status',
			     		   		     		   	 	value		  : 'SELECT',
			     		   		     		   	 	//width		  : '40%'	,
			     		   		     		   	 	store         : statusStore,
			     		   		     		   	 	displayField  : 'name',
			     		   		     		   	 	valueField    : 'id',
			     		   		     		   	 	triggerAction : 'all',
			     		   		     		   	 	typeAhead     : false,
			     		   		     		   	 	editable      : false,
			     		   		     		        listeners	  : {select : function(){
			     		   	   						                 bindValue('status', 'statusId');
			     		   	   					                     } 
			     		   	   			                         }
			     		   		     		    },
					     		   	   			{
					     		   	   			 	xtype		: 'hidden',
					     		   	   			 	id			: 'statusId'
					     		   	   			},
			     		   		     		    {xtype : 'displayfield', value: 'Priority: ', width : 90},
			     		   		     		    {
			     		   		     		    	xtype		  : 'combo',
			     		   		     		    	id			  : 'priority', 
			     		   		     		    	value		  : 'SELECT',
			     		   		     		    	store         : priorityStore,
			     		   		     		    	displayField  : 'name',
			     		   		     		    	valueField    : 'id',
			     		   		     		    	triggerAction : 'all',
			     		   		     		    	typeAhead     : false,
			     		   		     		    	editable      : false ,
			     		   		     		        listeners	  : {select : function(){
			   	   						                                 bindValue('priority', 'priorityId');
			   	   					                                 } 
			   	   			                                      }
			     		   		     		     },
			     		   		     		     {
						     		   	   			 	xtype		: 'hidden',
						     		   	   			 	id			: 'priorityId'
						     		   	   		 },
			     		   		     		   ]
			     		   	},
			     		   {
								xtype		: 'compositefield',
								fieldLabel	: 'Actual Start Date',
								items		: [
								     		    {
								     		    	xtype		: 'datefield',
								     		   	 	id			: 'actualStartDate',
								     		   	    format      : 'Y-m-d',
									     		   	vtype       : 'daterange',
		                                            endDateField: 'actualEndDate',
								     		   	 	width		: 167	
								     		    },
								     		    {xtype : 'displayfield', value: 'Act End Date: ', width : 90},
								     		    {
								     		    	xtype		: 'datefield',
								     		    	id			: 'actualEndDate',
								     		    	format      : 'Y-m-d',
								     		   	 	width		: 167	
								     		    }
								     		   ]
							},
							{
								xtype		: 'compositefield',
								fieldLabel	: 'Actual Budget',
								items		: [
								     		    {
								     		    	xtype		: 'textfield',
								     		   	 	id			: 'actualBudget',
								     		   	 	width		: 167	
								     		    },
								     		    {xtype : 'displayfield', value: 'Actual Hrs.: ', width : 90},
								     		    {
								     		    	xtype		: 'textfield',
								     		    	id			: 'actualHrs',
								     		   	 	width		: 167	
								     		    }
								     		   ]
							},
			     		   	
			     		   	{
			     		   		xtype		: 'textarea',
			     		   		id			: 'projectDetails',
			     		   		fieldLabel	: 'Project Details',
			     		   		height		: 80,
			     		   		width		: 490	
			     		   	},
			     		   
			     		   ],
			 bbar		: 	{
				 				 xtype		: 'toolbar',
				 				 buttonAlign: 'right',
					 				items		: [ {
		                                xtype  : 'button',
		                                text   : 'Clear',
		                                id     : 'newButton',
		                                handler: function(){newProjectForm(projectPanel);}
		                             },'-',
		                             {
		                                xtype  : 'button',
		                                text   : 'Edit',
		                                id     : 'editButton',
		                                handler: function(){editProjectForm();}
		                             },'-',
		                             {
		                              xtype   : 'button',
		                              text    : 'Save',
		                              id      : 'saveButton',
		                              handler : function(){
		                            	           projectInfoValidateAndSave(projectPanel,mainProjectFromIds);
		      		   	                           }
		                             }
						      		 ]
			 				  }    		   
		};
		
	var projectInfoPanel = {
            xtype       : 'panel',
            id          : 'projectInfoPanel',
            width       : '79%', 
            height		: 310,
            frame 		: true,
            items		: [basicInformationPanel]
	};
            
	
	var projectSubTabPanel = 
	{
	    xtype      :'tabpanel',
	    id         :'projectSubTabPanel',
	    width      :'79%',
	    height 	   :240,
	    activeTab  :0,
	    frame      :true,
	    items      :[
				{
				    xtype   : 'panel',
				    title   : 'Estimations',
				    frame   : true,
				    layout  : 'hbox',
				    padding : '5px',
				    items   : [],
				    tbar    : {
				                xtype      :'toolbar',
				                buttonAlign : 'left',
				                items       :[
												'-',
				                                 {
				                                   xtype :'button',
				                                   id    :'addEstimationButton',
				                                   text  :'Add Estimation',
				                                   handler: showEstimationScreen
				                                  },
				                                 '-'
				                               ]
				               }
				 },    
                 {
                    xtype   : 'panel',
                    title   : 'Tasks',
                    id      : 'taskPanel',
                    frame   : true,
                    layout  : 'hbox',
                    padding : '5px',
                    autoScroll: true,
                    items   : [CRM.commons.createGrid('taskHomeGrid',projectTaskStore,taskGridColumnModel)],
                    tbar    : {
		                        xtype      :'toolbar',
		                        buttonAlign : 'left',
		                        items       :[
												'-',
		                                         {
		                                           xtype :'button',
		                                           id    :'addTaskButton',
		                                           text  :'Add Task',
		                                           handler: function(){
																	showTaskList().show();
																	}
		                                          },
		                                         '-'
		                                       ]
		                       }
                 },
                 {
                    xtype   :'panel',
                    title   :'Members',
                    frame   :true,
                    id      :'membersPanel',
                    autoScroll: true,
                    items   :[CRM.commons.createGrid('memberGrid',memberStore,CRM.SPComp.createUserColumnModel())],
                    tbar    :{
                                xtype      :'toolbar',
                                buttonAlign : 'left',
                                items       :[
                                                 {
                                                   xtype :'button',
                                                   id    :'addMembersButton',
                                                   text  :'Add Member',
                                                   handler: function(){showMemberList().show();}
                                                 
                                                  }/*,
                                                  '-',
                                                  {
                                                    xtype : 'button',
                                                    id    : 'addExternalMemberButton',
                                                    text  : 'Add External Member',
                                                    handler: addExternalMember
                                                  },'-' */
                                               ]
                               }
                  },
                  {
                         xtype     :'panel',
                         id        :'issuePanel',
                         title     :'Issues',
                         frame     :true,
                         autoScroll : true, 
                         height     : 400,
                         activeTab :0,
                         items     :[CRM.commons.createGrid('issueHomeGrid',issueHomeStore,issueGridColumnModel)], 
                         tbar       :{
		                                  xtype      :'toolbar',
		                                  buttonAlign : 'left',
		                                  items       :[
														'-',
			                                             {
			                                                 xtype  :'button',
			                                                 id     :'addIssuesButton',
			                                                 text   :'Add Issues',
			                                                 handler :  function(){
															
															      showIssueList().show();
                                                              
                                                			}
				                                      	 },
			                                              '-'
			                                            ]
                                       }	
                    },
                    {
                        xtype     :'panel',
                        id        :'documentsPanel',
                        title     :'Documents',
                        iconCls   :'Document',
                        frame     :true,
                        activeTab :0,
                        items     :[CRM.commons.createGrid('projectDocGrid', uploadProjectDocStore, CRM.SPComp.createUploadDocColumnModel())],
                        tbar        : {
			                            xtype       : 'toolbar',
			                            buttonAlign       : 'left',
			                            items       : [
													   '-',
			                                           {
														icon	: '../images/upload.jpg',
			                                            id		: 'uploadNewDocumentButton',
			                                            tooltip : 'Upload New',
			                                            handler :  function(){
			                                                        	var formPanel = Ext.getCmp('projectPanel');
			                                                        	var projectId = formPanel.getForm().findField('projectId').getValue();
			                                            				showProjectDocumentUploader(projectId);
			                                            			}
			                                           },
													   '-',
													   {
			                                        	    icon	: '../images/refresh.jpg',
			                                                id		: 'showDocumentButton',
			                                                //text    : 'Show',
			                                                tooltip	: 'Refresh',
			                                                handler :  function(){
								                                        	    var form = Ext.getCmp('projectPanel');
								                                        	    var myUploadGrid = form.findById('projectDocGrid');
						                                           				var selectedProjectId = form.getForm().findField('projectId').getValue();
						                                           				showProjectDocGrid(selectedProjectId,myUploadGrid);//this method is in customer.js
			                                                			}
			                                               },
														'-'
			                                        ]
                          }
                    },
                    {
                          xtype     :'panel',
                          id        :'engagementPanel',
                          title     :'Engagement',
                          frame     :true,
                          activeTab :0,
                          items     :[],
                          tbar      :{
		                                 xtype      :'toolbar',
		                                 buttonAlign : 'left',
                                        items       :[
		                                                {
		                                                xtype:'button',
		                                                id    :'addEngagmentButton',
		                                                 text  :'Add Engagement'
		                                                },
		                                                '-',
		                                               ]
                                       } 
                      }
                  ]
        };

	var projectReportTab ={
			 xtype  : 'panel',
			 id     : 'projectReportTab',
			 title  : 'Report',
			 disabled:true, 
			 items  : []
	};

	var searchTab = {
    		xtype 	: 'panel',
    		id		: 'searchTab',
 	    	title	: 'Search',
 	    	items	: [
						CRM.SPComp.createProjectSearchComp(projectSearchStore,CRM.SPComp.createProjectColumnModel(), projectSearchCriteriaStore )
						
 	    	     	  ]
    };
    
    var detailsTab = {
    		xtype	: 'panel',
 	    	id		: 'detailsTab',
 	    	title	: 'Details',
 	    	frame	: false,
 	    	items	: [projectInfoPanel,
					   projectSubTabPanel]
    };
    
    
    var projectMainTab = new Ext.TabPanel({
    		xtype	: 'tabpanel',
    		id		: 'projectMainTab',
    		activeTab : 0,
    		height	: 650,
    		items	: [searchTab, detailsTab]
    });
    

	var projectPanel = new Ext.form.FormPanel({
        id          : 'projectPanel',
        autoHeight  : true,
        autoWidth   : true,
        frame       : false,
        items       : [
                         projectMainTab
                      ]
    });

	validateFormOnLoad(projectPanel, mainProjectFromIds);
	//newProjectForm();
	
	return projectPanel;
 };
     
    // Add Estimation Window
    var estimationWin; 
	function showEstimationScreen(){
		
        estimationWin = new Ext.Window({
      	title		: 'Create Estimation',
    	id			: 'estimationWindow',
    	width		: 570,
    	height		: 230,
    	border		: true,
    	plain		: false,
    	closable	: true,
    	collapsible : true,
    	animCollapse: true,
    	draggable 	: true,
    	maximizable : false,
    	onEsc		: true,
    	model		: true,
    	items		: [projectEstimationPanel('projectEstimationPanel')]
		});
        
    	estimationWin.show(this);
    	return estimationWin;
	};

	function estimationCloseWin(){
		   estimationWin.close();
		   };
	   

    var taskListWin;
	function showTaskList(){
		var formPanel = Ext.getCmp('projectPanel').getForm();
        var projectId = formPanel.findField('projectId').getValue();
        var projectName = formPanel.findField('projectName').getValue();
        
		taskListWin = new Ext.Window({
	      	title		: 'List of Employees',
	    	id			: 'taskListWindow',
	    	width		: 780,
	    	height		: 450,
	    	border		: true,
	    	plain		: false,
	    	closable	: true,
	    	collapsible : true,
	    	animCollapse: true,
	    	draggable 	: true,
	    	maximizable : false,
	    	onEsc		: true,
	    	model		: true,
	        layout      : 'vbox',
	    	items 	    : [createProjectTask(true,projectId,projectName,'remote')],
	    	autoDestroy : false
		});
		
		taskListWin.show(this);
	    return taskListWin;
	};

    
	 
	var issueListWin;
	function showIssueList(){
		taskListWin = new Ext.Window({
	      	title		: 'Create/Update Issues',
	    	id			: 'issueListWindow',
	    	width		: 780,
	    	height		: 450,
	    	border		: true,
	    	plain		: false,
	    	closable	: true, 
	    	collapsible : true,
	    	animCollapse: true,
	    	draggable 	: true,
	    	maximizable : false,
	    	onEsc		: true,
	    	model		: true,
	        layout      : 'vbox',
	    	items 	    : [createIssueDetails()],
	    	autoDestroy : false
		});
		
		taskListWin.show(this);
	    return taskListWin;
	};

    var memberListWin;
	function showMemberList(){
		 memberListWin = new Ext.Window({
	      	title		: 'List of Employees',
	    	id			: 'memberListWindow',
	    	width		: 930,
	    	height		: 260,
	    	border		: true,
	    	plain		: false,
	    	closable	: true,
	    	collapsible : true,
	    	animCollapse: true,
	    	draggable 	: true,
	    	maximizable : false,
	    	onEsc		: true,
	    	model		: true,
	        layout      : 'vbox',
	    	items 	    : [projectMemberPanel()],
	    	autoDestroy :false,
	    	bbar        :{
			    	         xtype        : 'toolbar',
			    	         buttonAlign  : 'right',
			    	         items        :[
		    	                          {
			    	                          xtype   :'button',
			    	                          text    :'Assign',
			    	                          id      :'assignMember',
			    	                          handler : function(){updateMemberform(Ext.getCmp('projectPanel'));}
			    	                      },'-',
 			    	                      {
                                              xtype   : 'button',
                                              text    : 'Cancel',
                                              id      : 'cancleButton',
                                              handler : closeMemberForm
 	 			    	                  }
		    	                          ]
	           }
		});
		
	    memberListWin.show(this);
	    return memberListWin;
	};

	 var extMemberWin; 
		function addExternalMember(){
			
	        extMemberWin = new Ext.Window({
	      	title		: 'Create External Member',
	    	id			: 'estimationWindow',
	    	width		: 800,
	    	height		: 320,
	    	border		: true,
	    	plain		: false,
	    	closable	: true,
	    	collapsible : true,
	    	animCollapse: true,
	    	draggable 	: true,
	    	maximizable : false,
	    	onEsc		: true,
	    	model		: true,
	    	items		: [addExternalMemberForm()]
			});
	        
	        extMemberWin.show(this);
	    	return extMemberWin;
		};

	

   function updateMemberform(formPanel){
	    var selectedProjectId = Ext.getCmp('projectId').getValue();
		//var formPanel = Ext.getCmp('projectPanel');
		var values = formPanel.getForm().getValues();
		var data = Ext.encode(values);
        var record = Ext.getCmp('userGrid').getSelectionModel().getSelections();

		var userId='';
		for (i=0; i < record.length; i++){
			var id = record[i].get('employeeId');
			if(userId == ''){
				userId = id;
			}
			else{
				userId = userId+","+id;
			}
		}
		Ext.Ajax.request({
			url		: 'project/addMember?empId='+userId+'&projectId='+selectedProjectId,
			method  : 'POST',
			success : function(result, request)
			          {
						 alert("Member assign Successfully.");
				         var jsonData = Ext.util.JSON.decode(result.responseText);
				         var responsedMemberId = jsonData.data;
				         Ext.getCmp('empTypeId').setValue(responsedMemberId);
				         showMember(selectedProjectId);
			             memberListCloseWin();
		              },
		    failure : function(){
		            	  alert("failure");
		             },
		              jsonData : data
		});
   };

	//function to load member list into grid
   
   function showTask(selectedProjectId){
	   				var taskGrid = Ext.getCmp('taskHomeGrid');
	   				taskGrid.store.removeAll();
	   				taskGrid.store.reload({
	   							params	: {
	   										taskGridProjectId : selectedProjectId
	   									  }
	   				});
   };
	
   function showIssue(selectedProjectId){
	        var issueHomeGrid=Ext.getCmp('issueHomeGrid'); 
	        issueHomeGrid.store.removeAll();
	        issueHomeGrid.store.reload({
						params	: {
									issueGridProjectId : selectedProjectId
								  }
		});
};
	function showMember(selectedProjectId){
		            var memberGrd = Ext.getCmp('memberGrid');
			    	memberGrd.store.removeAll();
			    	memberGrd.store.reload({
			        			params: {
			        						memberProjectId: selectedProjectId
			        					}
			        		});
				};
   

   function reloadMember(){
 	   var selectedCriteria = Ext.getCmp('memberType').getValue();
 	  var selectedProjectId = Ext.getCmp('projectId').getValue();
 	   var memberGrid = Ext.getCmp('userGrid');
 	   memberGrid.store.removeAll();
 	   memberGrid.store.reload({
 	         params : {criteria : selectedCriteria,
 		               projectId: selectedProjectId
 		              }
        });
    };		

  //onload calls
  //Ext.getCmp('userGrid').setAutoScroll(true); 
	
   function memberListCloseWin(){
	   memberListWin.close();
	   };
	   
   function estimationCloseWin(){
	   estimationWin.close();
	   };
   
   function closeMemberForm(){
	   memberListWin.close();
	  }

   function memberList(){
		var grid = Ext.getCmp('memberGrid');
		grid.store.removeAll();
		grid.store.reload();
	   }
   
   function showProjectDocumentUploader(projectId){
   		createProjectDocumentUploader(projectId);
   };
   
   function showProjectDoc(selectedProjectId){
	   var myUploadGrid = Ext.getCmp('projectDocGrid');
			
		myUploadGrid.store.removeAll();
		myUploadGrid.store.reload({
			params : {
				projectId : selectedProjectId
			 }
		});
	};
	
	function showProjectDocGrid(selectedProjectId,myProjectGrid){
			myProjectGrid.store.removeAll();
			myProjectGrid.store.reload({
				params : {
					projectId : selectedProjectId
				 }
			});
		};
   
   function deleteDetails(){
            var formPanel = Ext.getCmp('projectPanel');
	        var values = formPanel.getForm().getValues();
	        var encoded = Ext.encode(values);

		    var record = Ext.getCmp('memberGrid').getSelectionModel().getSelected();
		    //alert(record.get('firstName'));
		    var selectedMemberId = record.get('employeeId');
		    
		    var selectedProjectId = Ext.getCmp('projectId').getValue();
		Ext.Ajax.request({
			method  : 'POST',
	        url     : 'project/deleteMemberDetail?memberId='+selectedMemberId+'&projectId='+selectedProjectId,
	      		success : function() {
			              memberList();
	            			},
	            failure:function() { 
	            				alert("failure");
	               			},
	        jsonData: encoded        			
			});
		}

		function showMessage(){
			 Ext.MessageBox.show({
    	            title	: 'Confirm',
    	            msg		: 'Are you sure you want to delete this records:',
    	            width	:200,
    	            buttons	: Ext.MessageBox.OKCANCEL,
    	            multiline: false,
    	            fn		: function(btn, text) {
	         	            	if (btn == 'ok') {
	         	            		deleteDetails();
	         	            	   }
	         	            	}
    	           });
				};

		

   
